import { Component, Input, ChangeDetectionStrategy } from '@angular/core';

@Component({
  templateUrl: './demo4.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Demo4Component {}

@Component({
  selector: 'tab-content-lazy',
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    <div>
      {{ text }}
    </div>
  `,
})
export class TabContentLazyComponent {
  @Input() data: string = '';
  text = 'Loading ...';

  ngOnInit() {
    setTimeout(() => {
      this.text = `This is lazy content "${this.data}"`;
    }, 1000);
  }
}
